from typing import List
class Solution:
  def removeDuplicates(self, nums: List[int]) -> int:
    if not nums:
      return 0

    count = 0
    for i in range(len(nums)):
      if nums[count] != nums[i]:
        count += 1
        nums[count] = nums[i]
    return count